package com.bdth.weget.net.controller;

import com.bdth.weget.net.base.SessionData;
import com.bdth.weget.net.vo.DataGridData;
import com.bdth.weget.vo.JT0200;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2019/7/15.
 */
@Controller
@RequestMapping("/message")
public class MessageController {

    @RequestMapping("list")
    @ResponseBody
    public DataGridData<JT0200> getMessage(){
        Iterator<JT0200> iterator = SessionData.RECEIVE_TEST.iterator();
        List<JT0200> list = new ArrayList<>();
        while (iterator.hasNext()){
            list.add(iterator.next());
        }
        DataGridData<JT0200> result = new DataGridData<JT0200>(list.size(),list);
        return result;
    }
}
